import { trimSpace, trimSpecialChar } from 'src/util/common';
const messageConfig = {
  Message: { key: 'Message', func: '' },
  CallMessage: { key: 'Call Message', func: '' },
  SendMessage: { key: 'Send Message', func: '' },
  ReplyMessage: { key: 'Reply Message', func: '' },
  CreateMessage: { key: 'Create Message', func: '' },
  DeleteMessage: { key: 'Delete Message', func: '' },
  DiagonalMessage: { key: 'Diagonal Message', func: '' },
  MessageToSelf: { key: 'Message to Self', func: '' },
  RecursiveMessage: { key: 'Recursive Message', func: '' },
  LostMessage: { key: 'Lost Message', func: '' }
};

const noModelConfig = [
  'Note',
  'Containment',
  'ImageShape',
  'TextBox',
  'HorizontalSeparator',
  'VerticalSeparator',
  'RectangularShape',
  'Anchor',
  'Legend'
];

//// 点击cell上的加号按钮（添加属性按钮）,弹出下拉选择菜单配置

const menuItem = {
  "Block": ["Constraint Property", "Flow Property", "Part Property", "Reference Property", "Value Property", "Signal Reception", "Full Port", "Proxy Port", "Operation"],
  "InterfaceBlock": ["Flow Property", "Reference Property", "Value Property", "Operation", "Signal Reception", "Proxy Port"],
  "ConstraintBlock": ["Constraint Property", "Constraint Parameter"],
  "ValueType": ["Property", "Operation"],
  "Enumeration": ["Property", "Enumeration Literal", "Operation"],
  "Signal": ["Property"],
  "Interface": ["Property", "Operation", "Signal Reception"],
  "TestCase": ["Property", "Operation", "Signal Reception", "Port"],
  "State": ["Region"],
  "CompositeState": ["Region"],
  "UseCase": ["ExtensionPoint"],
  "SystemContext": ["Constraint Property", "Flow Property", "Part Property", "Reference Property", "Value Property", "Signal Reception", "Full Port", "Proxy Port", "Operation"],
  "Alternatives": ["Interaction Operand"],
  "Loop": ["Interaction Operand"],
  "Option": ["Interaction Operand"],
  "Activity": ["Property", "Operation", "Signal Reception", "Port"],
  "StateMachine": ["Property", "Operation", "Signal Reception", "Port"],
  "ConditionalNode": ["Clause", "else Clause"]
};
Object.keys(menuItem).forEach(key => {
  menuItem[key] = menuItem[key].map(name => ({
    label: name,
    icon: window.ABOUT_PATH + '/images/sysml/' + trimSpace(name) + '.svg',
    value: trimSpace(name)
  }));
});

const edgeConfig = [
  //// common
  'Containment', 'Abstraction', 'Dependency', 'Allocate', 'Realization', "Anchor",
  //// BDD
  'Association', 'DirectedAssociation', 'Aggregation', 'DirectedAggregation', 'Composition', 'DirectedComposition', 'Generalization', 'Usage', 'Link', 'ItemFlow',
  //// IBD
  'Connector', 'BindingConnector',
  //// PKG
  'PackageImport', 'ElementImport',
  //// RD
  'Satisfy', 'DeriveReqt', 'Copy', 'Trace', 'Verify', 'Refine',
  //// UCD
  'Include', 'Extend', 'Association', 'Generalization',
  //// SD
  "Message", 'CallMessage', "SendMessage", "ReplyMessage", "CreateMessage", "DeleteMessage", "LostMessage", "FoundMessage", "MessageToSelf", "DurationConstraint", "RecursiveMessage",
  //// SMD
  "ControlFlow", "ObjectFlow", "ExceptionHandler",

  "Transition"
];

export { noModelConfig, menuItem, messageConfig, edgeConfig };
